/*
 * Copyright (c) 2019 DawnFramework. All Rights Reserved.
 * Licensed under the MIT (LICENSE) license.
 */

package org.dawn.common.apiclient.model;

import org.dawn.common.apiclient.except.ApiException;
import org.dawn.common.core.except.IError;

import java.util.List;
import java.util.Map;

/**
 * @author Willard Hu on 2019-04-25.
 */
public abstract class AbstractApiResponse {
    protected int statusCode;
    protected Map<String, List<String>> headers;
    protected IError error;
    protected String message;

    public abstract boolean success();

    public abstract void check() throws ApiException;

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public Map<String, List<String>> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, List<String>> headers) {
        this.headers = headers;
    }

    public IError getError() {
        return error;
    }

    public void setError(IError error) {
        this.error = error;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
